package com.pubinfo.passbook.data.controller;

import com.pubinfo.passbook.common.entity.TSourceArtificial;
import com.pubinfo.passbook.common.model.dto.MDM.TSourceArtificialParam;
import com.pubinfo.passbook.common.model.dto.file.ArtificialParam;
import com.pubinfo.passbook.common.model.vo.base.JsonResult;
import com.pubinfo.passbook.common.model.vo.base.MyPage;
import com.pubinfo.passbook.common.model.vo.rule.TSourceArtificialDetailVo;
import com.pubinfo.passbook.data.service.impl.ArtificialServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

@RestController
@RequestMapping(value = "Artifical")
@Api(tags = "人工报账")
@Slf4j
public class ArtificalController {
  @Autowired
  ArtificialServiceImpl artificialService;

  @PostMapping("saveArtificial")
  @ApiOperation(value = "保存人工审核数据")
  public JsonResult<Boolean> saveArtificial(ArtificialParam artificialParam) throws IOException {
    return JsonResult.success(artificialService.saveArtificial(artificialParam));
  }
  
  @PostMapping("selectArtificial")
  @ApiOperation(value = "查询人工审核数据")
  public JsonResult<MyPage<TSourceArtificialDetailVo>> selectArtificialByCreateUser(@RequestBody TSourceArtificialParam param) {
    return JsonResult.success(new MyPage(artificialService.selectArtificialByCreateUser(param)));
    
  }
}
